/**
<<<<<<< HEAD
 * Copyright (C) 2020-2021 杭州优诗科技有限公司
=======
 * Copyright (C) 2019-2021 杭州优诗科技有限公司
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
 *
 * This file is part of UnitSpirit.
 * @author wupingfu
 * @version 1.0.0
 * 
 **/
package com.unitspirit.sample.cmbchina;

import static org.junit.Assert.assertEquals;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.powermock.api.mockito.PowerMockito;

import com.alibaba.fastjson.parser.ParserConfig;
import com.unitspirit.runtime.GlobalUnitInit;

import cn.luischen.dao.UserDao;
import cn.luischen.model.UserDomain;

/**
 * @author wupf
 *
 */
public class UserServiceImpl2_WHTest {

	@InjectMocks
	com.unitspirit.sample.cmbchina.UserServiceImpl2 unitspirit_fixture;
	@Mock
	UserDao mock_UserDao;

	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
	* 测试方法初始化.
	* 
	* @throws Exception 
	*         if the initialization fails for some reason 
	*  
	* @generatedBy UnitSpirit at 2021-07-05 11:06:21
	*/
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	@Test
	public void test_updateUserInfo_0113_190019_049_1_0() throws Throwable {
		UserDomain user = new UserDomain();
		user.setUid(1);

		PowerMockito.when(mock_UserDao.updateUserInfo(Mockito.any(cn.luischen.model.UserDomain.class))).thenReturn(1);

		int unitspirit_result = unitspirit_fixture.updateUserInfo(user);
<<<<<<< HEAD
		assertEquals(1, unitspirit_result);
=======
		assertEquals(0, unitspirit_result);
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
	}
}
